package com.thinker.interview.dynamic_datasource.dynamic_datasource;

public class RegionDataSourceContextHolder {

    private static final ThreadLocal<String> CONTEXT = new ThreadLocal<>();

    public static void setRegion(String region) {
        CONTEXT.set(region.toUpperCase());
    }

    public static String getRegion() {
        return CONTEXT.get();
    }

    public static void clear() {
        CONTEXT.remove();
    }
}
